#ifndef DEFINE_H
#define DEFINE_H

#include <stdint.h>
#include <stdio.h>
#include <string.h>

#include "em_emu.h"
#include "em_cmu.h"
#include "em_chip.h"
#include "em_leuart.h"
#include "em_int.h"
#include "em_gpio.h"
#include "em_adc.h"
#include "em_msc.h"
#include "em_letimer.h"
#include "em_wdog.h"
#include "em_rtc.h"

#include "delay.h"
#include "adc.h"
#include "sx127x.h"
#include "efm32g_it.h"
#include "crc.h"
#include "spi.h"
#include "def.h"
#include "letimer.h"
#include "ioi2c.h"
#include "dealData.h"
#include "fonts.h"
#include "rtc.h"
#include "wdog.h"

#define DBG_UART LEUART0
#define DBG_UART_CLOCK cmuClock_LEUART0
#define TX_PORT gpioPortE
#define RX_PORT gpioPortE
#define TX_PIN 14
#define RX_PIN 15

#define KEY2_PORT gpioPortE
#define KEY2_PIN  13

#define KEY3_PORT gpioPortE
#define KEY3_PIN  11

#define COIL_PORT gpioPortF
#define COIL_PIN 2
#define COIL_PIN_WRITE(value) (value > 0)?GPIO_PinOutSet(COIL_PORT, COIL_PIN):GPIO_PinOutClear(COIL_PORT, COIL_PIN)

//#define LED1_PORT gpioPortF
//#define LED1_PIN 3
//#define LED1_PIN_WRITE(value) (value > 0)?GPIO_PinOutSet(LED1_PORT, LED1_PIN):GPIO_PinOutClear(LED1_PORT, LED1_PIN)

//#define LED2_PORT gpioPortF
//#define LED2_PIN 4
//#define LED2_PIN_WRITE(value) (value > 0)?GPIO_PinOutSet(LED2_PORT, LED2_PIN):GPIO_PinOutClear(LED2_PORT, LED2_PIN)

//#define LED3_PORT gpioPortF
//#define LED3_PIN 5
//#define LED3_PIN_WRITE(value) (value > 0)?GPIO_PinOutSet(LED3_PORT, LED3_PIN):GPIO_PinOutClear(LED3_PORT, LED3_PIN)

#define LED4_PORT gpioPortA
#define LED4_PIN 0
#define LED4_PIN_WRITE(value) (value > 0)?GPIO_PinOutSet(LED4_PORT, LED4_PIN):GPIO_PinOutClear(LED4_PORT, LED4_PIN)

#define LED5_PORT gpioPortA
#define LED5_PIN 1
#define LED5_PIN_WRITE(value) (value > 0)?GPIO_PinOutSet(LED5_PORT, LED5_PIN):GPIO_PinOutClear(LED5_PORT, LED5_PIN)

#define MOTO_PORT gpioPortF
#define MOTO_PIN 3
#define MOTO_PIN_WRITE(value) (value > 0)?GPIO_PinOutSet(MOTO_PORT, MOTO_PIN):GPIO_PinOutClear(MOTO_PORT, MOTO_PIN)

#endif 
